import Vue from 'vue'
import App from './App'
import {router,RouterMount} from './router'
import {BASE_URL,HEADER} from './config.js'
Vue.use(router)
Vue.config.productionTip = false

App.mpType = 'app'

import * as Util from '@/utils/util.js'
//原型追加工具函数
Vue.prototype.$util = Util;
//注册底部
import TabBar from "./common/TabBar.vue"
Vue.component('TabBar', TabBar);  

import tools from './mixin/tools.js'
Vue.mixin(tools);

//引入uView库
import uView from 'uview-ui';
Vue.use(uView);

// 公共域名挂载原型链
Vue.prototype.global = {
	url: BASE_URL
}

import store from './store/index.js'
// 引入uView提供的对vuex的简写法文件
let vuexStore = require('./store/$u.mixin.js');
Vue.mixin(vuexStore)
const app = new Vue({
	...App,
	store
})

import httpInterceptor from '@/common/http.interceptor.js';
Vue.use(httpInterceptor, app);
// http接口API抽离，免于写url或者一些固定的参数
import api from '@/common/api.js';
Vue.use(api, app);
// #ifdef H5
	RouterMount(app,router,'#app');
// #endif

// #ifndef H5
	app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif
